﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;

namespace CSP.DataAccess
{
    
    public class HBHelperFactory
    {
        /// <summary>
        /// 获取Hubble 配置文件的Key
        /// </summary>
        private const string CONNKEY = "CSP.HB";

        private static string GetConnectionString(string connKey)
        {
            return ConfigurationManager.ConnectionStrings[connKey].ToString();
        }

        /// <summary>
        /// 获取CSP.BBS连接字符串
        /// </summary>
        /// <returns></returns>
        public static string GetHBConnectionString()
        {
            return GetConnectionString(CONNKEY);
        }

        public static DataSet ExecuteDataset( string commandText, int cacheTimeOut = 0)
        {
            string connString = GetHBConnectionString();
            return HBHelper.ExecuteDataset(connString,commandText, cacheTimeOut);
        }


    }
}
